package com.moon.controller;

import com.moon.dto.TestDTO;
import com.moon.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private TestService testService;
    @GetMapping(value = "/get")
    public String get(){
        boolean flag = true;
        while(flag){
            System.out.println("日志打印");
        }
      return "ok";
    }


    @GetMapping(value = "/get1")
    public String get1(){
        TestDTO testDTO = new TestDTO();
        testDTO.setUrl("www.baidu.com");
        testDTO.setName("百度");
        String fun = testService.fun(testDTO);
        System.out.println("/get1");
        return fun;
    }

    @GetMapping(value = "/gc")
    public String gc(){
        boolean flag = true;
        System.out.println("/gc");
        System.gc();
        return "gc";
    }

    @GetMapping(value = "/gct")
    public String gct(){
        boolean flag = true;
        System.out.println("/gc");
        return "gc";
    }
}
